﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Wx.Standard.IService;
using Wx.Standard.Options;
using Wx.Standard.Service;

namespace Wx.Standard
{
    public class WxPay
    {
        IPay weChatPay = null;


        internal PayOption payOption;
        internal HttpContext context;
        public WxPay(IHttpContextAccessor httpContextAccessor, IOptions<PayOption> options)
        {
            payOption = options.Value;
            context = httpContextAccessor.HttpContext;
        }
        private WxPay()
        {
        }
        /// <summary>
        /// 微信支付
        /// </summary>
        public IPay Pay
        {
            get
            {
                if (weChatPay == null)
                {
                    this.weChatPay = new Pay(this);
                }
                return weChatPay;
            }
        }
    }
}
